InMemoryDatabaseCache
Provides an in-memory cache for in-memory databases.
On iOS, SQLiter uses "file:{name}?mode=memory&cache=shared" for named in-memory databases, which means databases with the same name share data. This cache allows us to:
Reuse database instances across calls with the same userId
Properly close and clear databases between tests to ensure isolation
When clearEntry is called, the database driver is closed, which causes SQLite to automatically delete the shared in-memory database (since it's the last connection).
Functions
Link copied to clipboard
Clears an entry from the cache based on the provided userIDEntity. This also closes the database driver, which causes SQLite to delete the shared in-memory database.
Link copied to clipboard
fun getOrCreate(userIDEntity: <Error class: unknown class>, create: () -> <Error class: unknown class>): <Error class: unknown class>